<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>MeteoCal - Login</title>
        <h:outputStylesheet library="css" name="myTheme.css"/>
        <h:outputStylesheet library="css" name="login-register.css"/>
    </h:head>
    <h:body styleClass="loginRegClass">
        <h:form>
            <p:growl id="growl"/>
            <div align="center">
                <p:graphicImage library="images" name="logo.png" style="padding: 50px"/>
            </div>
            <p:panel id="loginPanel" header="Please sign in" styleClass="loginPanel">
                <p:focus context="loginPanel"/>
                <h:panelGrid id="loginGrid" columns="1">
                    <p:inputText id="usernameInput" value="#{loginBean.username}" 
                                 required="true" label="Username"
                                 requiredMessage="Please insert a username"/>
                    <p:password id="passwordInput" value="#{loginBean.password}" 
                                required="true" label="Password"
                                requiredMessage="Please insert a password"/>
                    <p:commandButton value="Login" 
                                     action="#{loginBean.login()}" 
                                     update="loginGrid, growl"/>
                </h:panelGrid>
                <p:watermark for="usernameInput" value="Username" id="watermarkUsername" />
                <p:watermark for="passwordInput" value="Password" id="watermarkPassword" />
            </p:panel>
        </h:form>
        <div align="center" style="padding: 20px">
            <p:link outcome="register" value="Don't have an account yet? Register!" />
            </div>
        <div align="center" style="font-family: 'Helvetica Neue',Helvetica,Arial; font-size: 20px; padding: 20px; color: white; line-height: 130%;">
            Keep track of your important events <br/> avoiding bad weather conditions
        </div>
    </h:body>
</html>